package com.hehui.immersive;

import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Window;

public class MainActivity extends AppCompatActivity {

    private Toolbar mToolbar;
    private CoordinatorLayout mCoordinatorLayout;
    private AppBarLayout mAppBarLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        requestWindowFeature(Window.FEATURE_NO_TITLE);

        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        findViewById();

        ActivityPropertiesUtil.initWindowsProperties(this, true);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        ActivityPropertiesUtil.initActivityProperties(MainActivity.this, true);
                    }
                }, 5);
            }
        }, 5);
    }

    private void findViewById() {
        mToolbar = (Toolbar) findViewById(R.id.common_toolbar);
        mCoordinatorLayout = (CoordinatorLayout) findViewById(R.id.common_coordinator_layout);
        mAppBarLayout = (AppBarLayout) findViewById(R.id.common_appbar_layout);
    }
}
